package com.example.first_android_project;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class Act3 extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_act3);
		Button finok=(Button) findViewById(R.id.Ok_act3);
		finok.setOnClickListener(btnclick);
	}
	private OnClickListener btnclick = new OnClickListener() {
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.Ok_act3:
				Intent intent = new Intent ();
				intent.putExtra ("string_1",((EditText)findViewById(R.id.nom)).getText().toString());
				intent.putExtra ("string_2",((EditText)findViewById(R.id.prenom)).getText().toString());
				intent.putExtra ("int_1", Integer.parseInt(((EditText)findViewById(R.id.age)).getText().toString()));
				intent.putExtra ("long_1",Long.parseLong(((EditText)findViewById(R.id.numfetiche)).getText().toString()));
				setResult (Activity.RESULT_OK,intent);
				finish();
				break;
			
			}
		}
	};
}
